home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d897.lha / EPP / PModules / listAppend.e < prev    next >
Text File  |  1993-06-26  |  475b  |  22 lines

  1. OPT TURBO
  2.  
  3. PROC listAppend (theElement, theList)
  4.   DEF listCurrent
  5.  
  6.   /* NOTE:  both theElement and theList must be passed by reference. */
  7.   /* Appends theElement onto the end of theList.                     */
  8.  
  9.   listCurrent := ^theList
  10.   WHILE Next (listCurrent) <> NIL
  11.     listCurrent := Next (listCurrent)
  12.   ENDWHILE
  13.   IF ^theList = NIL
  14.     ^theList := ^theElement
  15.   ELSE
  16.     Link (listCurrent, ^theElement)
  17.   ENDIF
  18.   ^theElement := NIL
  19. ENDPROC TRUE
  20.   /* listAppend */
  21.  
  22.